package com.example.demo.com.example.demo.controller;

        import org.apache.poi.hssf.usermodel.HSSFCell;
        import org.apache.poi.hssf.usermodel.HSSFRow;
        import org.apache.poi.hssf.usermodel.HSSFSheet;
        import org.apache.poi.hssf.usermodel.HSSFWorkbook;

        import java.io.FileOutputStream;

public class demo {
    public static void main(String[] args)  throws  Exception{
        HSSFWorkbook sheets = new HSSFWorkbook();//定义一个新的工作簿
        HSSFSheet sheet= sheets.createSheet("第一给sheet页");//创建sheet页

        HSSFRow row = sheet.createRow(0);//创建行
        HSSFCell cell = row.createCell(0);//创建单元格
        cell.setCellValue("1");//设置值
        FileOutputStream fileOutputStream = new FileOutputStream("d:\\我的第一个workboot1.xls");

        sheets.write(fileOutputStream);
        fileOutputStream.close();



    }
}
